package file.day9_18.day02;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test03 {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("dos.txt",true);
        do {
            System.out.println("请输入内容：");
            String line = scanner.nextLine();
            if(line.contains("exit")){
                System.out.println("已退出输入");
                fos.close();
                break;
            }
            byte[] data = line.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
            System.out.println("写出完成");
        }while (true);

    }
}
